FROM zhangyudd/openjdk:alpine3.17-jdk8-maven3.8 as BUILD

LABEL maintainer="Docker Maintainers <edgar.z@foxmail.com>"

RUN apk update && apk upgrade \
  && apk add --no-cache git \ 
  && git clone https://github.com/apache/rocketmq-dashboard.git 
WORKDIR rocketmq-dashboard

COPY settings.xml /root/.m2/settings.xml
COPY application.yml src/main/resources/application.yml
COPY users.properties src/main/resources/users.properties

RUN mvn clean package -Dmaven.test.skip=true


FROM zhangyudd/openjdk:alpine3.17-jdk8

COPY --from=BUILD /rocketmq-dashboard/target/*.jar app.jar
RUN apk update && apk upgrade 
EXPOSE 8080

CMD java $JAVA_OPTS -jar app.jar
